<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<script type="text/javascript" src="js/jquery-1.12.4.js"></script>
	<script type="text/javascript">
		$(function(){
			$("th").css("background","#ff000066");
			
			$("table tr:even").css("background","#ffeb3bb8");
		})
		function off(id) {
			if (confirm("确认删除该考勤记录吗？")) {
				$.getJSON("AttenceDeleteServlet", "id=" + id, judgeFina);

				function judgeFina(data) {
					if (data.result == "true") {
						alert(data.message);
						location.reload();
					}else{
						alert(date.message);
					}
				}
			}
		}
	</script>
	<div align="center">
		<h1 align="center">考勤信息记录表</h1>
		<table border="1" align="center">
			<tr>
				<th>员工姓名</th>
				<th>所属部门</th>
				<th>考勤日期</th>
				<th>考勤状态</th>
				<th>操作</th>
			</tr>
			<c:forEach var="list" items="${requestScope.list}">
				<tr>
					<td align="center">${list.empName }</td>
					<td align="center">${list.dept}</td>
					<td align="center">${list.chkDate}</td>
					<td align="center">${list.status}</td>
					<td align="center"><a style="text-decoration: none;" onclick="off(${list.id})" href="#">删除</a></td>
				</tr>
			</c:forEach>
		</table>
		<a href="AttenceAdd.jsp" style="text-decoration: none;">考勤登记</a>
	</div>
</body>
</html>